﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MainPage.Master"
	CodeBehind="OfficerManagement.aspx.vb" Inherits="RWN.OfficerManagement" UICulture="th-TH" Culture="th-TH" %>

<%@ Register Assembly="NumericTextBox" Namespace="NumericTextBoxControl" TagPrefix="cc1" %>
<%@ MasterType VirtualPath="~/MainPage.Master" %>
<%@ Register Assembly="Sarayut.ControlLibrary" Namespace="Sarayut.ControlLibrary"
	TagPrefix="cc1" %>
<%@ Register Src="ucCheckPermission.ascx" TagName="ucCheckPermission" TagPrefix="uc1" %>
<%@ Register src="ucCalendar.ascx" tagname="ucCalendar" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
	<asp:ScriptManager ID="ScriptManager1" runat="server" 
		EnableScriptGlobalization="True" >
	</asp:ScriptManager>
	<asp:Label ID="lblHeader" runat="server" Font-Bold="True" ForeColor="#0099FF" 
        Text="จัดการข้อมูลผู้ใช้งาน"></asp:Label>
    <br />
	<uc1:ucCheckPermission ID="ucCheckPermission1" runat="server" UnitID="UT601" />
	<hr />
	<span class="wrap">
    <asp:Panel runat="server" DefaultButton="btnSearch" ID="pnlMain">
		<div>
			<table width="100%" cellpadding="0" cellspacing="0" class="profile" bgcolor="#FFFFFF">
				<tr>
					<td>
						<table>
							<tr>
								<td width="20%" bgcolor="#E0E0E0">
									ชื่อ-นามสกุล (ไทย):
								</td>
								<td>
									<asp:TextBox ID="txtNameTh" runat="server" Width="250px"></asp:TextBox>
								</td>
								<td width="20%" bgcolor="#E0E0E0">
									Name-Surname:
								</td>
								<td>
									<asp:TextBox ID="txtNameEn" runat="server" Width="250px"></asp:TextBox>
								</td>
							</tr>
							<tr>
								<td width="20%" bgcolor="#E0E0E0">
									ตั้งแต่วันที่:
								</td>
								<td>
									<uc2:ucCalendar ID="ccFrom" runat="server" ValidationGroup="valid" />
								</td>
								<td width="20%" bgcolor="#E0E0E0">
									ถึงวันที่:
								</td>
								<td>
									<uc2:ucCalendar ID="ccTo" runat="server" ValidationGroup="valid" />
								</td>
							</tr>
							<tr>
								<td width="20%" bgcolor="#E0E0E0">
									เบอร์โทร success
								</td>
								<td>
									<cc1:NumericTextBox ID="txtAppTel" runat="server" AllowZero="False" ControlMode="Text"
										DecimalSeparator="None" MaxLength="13" ThousandsSeparator="None" Width="150px" />
								</td>
								<td width="20%" bgcolor="#E0E0E0">
									หมายเลขนักธุรกิจ
								</td>
								<td>
										<asp:TextBox ID="txtAppId" runat="server" Width="150px"></asp:TextBox>
								</td>
							</tr>
							<tr>
								<td width="20%" bgcolor="#E0E0E0">
									เลขที่บัตรประชาชน
								</td>
								<td>
									<cc1:NumericTextBox ID="txtCardNo" runat="server" AllowZero="False" ControlMode="Text"
										DecimalSeparator="None" MaxLength="13" ThousandsSeparator="None" Width="150px" />
								</td>
								<td >
									&nbsp;
								</td>
								<td>
									&nbsp;
								</td>
							</tr>
							<tr>
								<td colspan="4" style="text-align: right">									
									<asp:Button ID="btnSearch" runat="server" Text="ค้นหา" Width="80px" 
										ValidationGroup="valid" />&nbsp;
									<asp:Button ID="btnReset" runat="server" Text="ตั้งค่าใหม่" Width="80px" />	&nbsp;
									<asp:Button ID="btnAdd" runat="server" Text="เพิ่ม" Width="80px" />
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
		<div>
			<asp:GridView ID="gvList" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" PageSize="20" Width="100%" 
                DataKeyNames="OFFICER_ID">
				<AlternatingRowStyle BackColor="White" />
				<Columns>
                    <asp:TemplateField HeaderText="แก้ไข">
                        <ItemTemplate>
                            <table border="0" cellpadding="1" cellspacing="1">
                                <tr>
                                    <td style="height: 18px;" align="center"><asp:LinkButton  runat="server" ID="btnEdit" AlternateText="OfficerEdit" ToolTip="OfficerEdit" CommandArgument='<%# Eval("OFFICER_ID") %>' CommandName="OfficerEdit" >แก้ไข</asp:LinkButton></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center"  CssClass="table_header" />
                    </asp:TemplateField>  
                    <asp:TemplateField HeaderText="แนบ">
                        <ItemTemplate>
                            <table border="0" cellpadding="1" cellspacing="1">
                                <tr>
                                    <td style="height: 18px;" align="center"><asp:LinkButton  runat="server" ID="btnAttach" AlternateText="Attachment" ToolTip="Attachment" CommandArgument='<%# Eval("OFFICER_ID") %>' CommandName="Attachment" >แนบ</asp:LinkButton></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center"  CssClass="table_header" />
                    </asp:TemplateField>   
                    <asp:TemplateField HeaderText="ต่ออายุ">
                        <ItemTemplate>
                            <table border="0" cellpadding="1" cellspacing="1">
                                <tr>
                                    <td style="height: 18px;" align="center"><asp:LinkButton  runat="server" ID="btnRemember" AlternateText="Remember" ToolTip="Remember" CommandArgument='<%# Eval("OFFICER_ID") %>' CommandName="Remember" >ต่ออายุ</asp:LinkButton></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center"  CssClass="table_header" />
                    </asp:TemplateField>   
                    <asp:TemplateField HeaderText="ชำระเงิน">
                        <ItemTemplate>
                            <table border="0" cellpadding="1" cellspacing="1">
                                <tr>
                                    <td style="height: 18px;" align="center"><asp:LinkButton  runat="server" ID="btnPayment" AlternateText="Payment" ToolTip="Payment" CommandArgument='<%# Eval("OFFICER_ID") %>' CommandName="Payment" >ชำระเงิน</asp:LinkButton></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                        <HeaderStyle HorizontalAlign="Center"  CssClass="table_header" />
                    </asp:TemplateField>   
					<asp:BoundField DataField="orderno" HeaderText="ลำดับ">
						<ItemStyle HorizontalAlign="Center" />
					</asp:BoundField>
					<asp:BoundField DataField="officer_app_id" HeaderText="รหัสนักธุรกิจ">
						<ItemStyle HorizontalAlign="Center" />
					</asp:BoundField>
					<asp:TemplateField HeaderText="ชื่อนักธุรกิจ">
						<ItemTemplate>
							<asp:Label ID="Label1" runat="server" Text='<%# Eval("OFFICER_FIRSTNAME_THA") & " " & Eval("OFFICER_LASTNAME_THA") %>'></asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:BoundField DataField="offcier_member_date" DataFormatString="{0:dd/MM/yyyy}"
						HeaderText="วันที่สมัครออนไลน์">
						<ItemStyle HorizontalAlign="Center" />
					</asp:BoundField>
					<asp:TemplateField HeaderText="สถานภาพ">
						<ItemTemplate>
							<asp:Label ID="Label2" runat="server" Text='<%# ConvertStatus(Eval("OFFICER_STATUS")) %>'></asp:Label>
						</ItemTemplate>
						<ItemStyle HorizontalAlign="Center" />
					</asp:TemplateField>
					<asp:TemplateField HeaderText="ประเภทของพนักงาน">
						<ItemTemplate>
							<asp:Label ID="Label3" runat="server" Text='<%# ConvertType(Eval("OFFICER_TYPE")) %>'></asp:Label>
						</ItemTemplate>
					</asp:TemplateField>
					<asp:BoundField HeaderText="เบอร์โทรศัพท์" DataField="OFFCIER_APP_TEL" />
				</Columns>
				<HeaderStyle BackColor="White" Height="30px" />
				<PagerStyle BackColor="White" />
				<RowStyle Height="20px" />
			</asp:GridView>
		</div>
    </asp:Panel>
	</span>
</asp:Content>
